package br.com.portalecbahia.util;

import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;


public class PortalECBahiaUtil {

	public static final String urlServer = "http://ec2-54-243-134-2.compute-1.amazonaws.com:8080/portalECBahia/";
	
	//public static final String urlServer = "http://10.0.1.63:8081/portalECBahia/";

	public static final String TAG	= "PortalECBahiaUtil";
	public static final int minimumListSize = 10;
	public static final int minimumListRanking = 14;

	public static long LIMIT_MIN = 0;
	public static long LIMIT_MAX = 0;
	public static String AUDIO_PLAYING = "";
	
	public static final String MY_AD_UNIT_ID = "a15072a4ca981bf";
	
	public static final String CONSUMER_KEY 			 = "TXGHErsfMnWDGwWbJSR3cw";


	public static final String CONSUMER_SECRET 		 = "nCO5Rz03lH1VGITnP744ABKZUuHQsJvYcFiq4DVNo";


	public static final String PREF_ACCESS_TOKEN_SECRET = "accessTokenSecret";

	public static final String PREF_ACCESS_TOKEN 		 = "accessToken";

	public static final String	CALLBACK_URL_DETAIL			 = "twitter://callback_portalecbahia"  ;

	public static final String	CALLBACK_URL_ACTION			 = "twitter://callback_portalecbahia_action"  ;



	   
    public static boolean haveNetworkConnection(Context context) {    	
        boolean haveConnectedWifi = false;
        boolean haveConnectedMobile = false;

        ConnectivityManager cm = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
        NetworkInfo[] netInfo = cm.getAllNetworkInfo();
        for (NetworkInfo ni : netInfo) {
            if (ni.getTypeName().equalsIgnoreCase("WIFI"))
                if (ni.isConnected())
                    haveConnectedWifi = true;
            if (ni.getTypeName().equalsIgnoreCase("MOBILE"))
                if (ni.isConnected())
                    haveConnectedMobile = true;
        }
        return haveConnectedWifi || haveConnectedMobile;
    }
}
